package net.biancheng.bean;

import lombok.Data;
import net.biancheng.common.core.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Transient;
import java.util.ArrayList;
import java.util.List;

/**
 * @author: lb
 * @date: 2023/8/1 14:59
 * @desc: 菜单权限
 **/
@Data
@Entity
@org.hibernate.annotations.Table(appliesTo = "sys_menu", comment = "菜单权限表")
public class SysMenu extends BaseEntity {

    @Column(name = "menu_name", columnDefinition = "varchar(50) comment '菜单名称'")
    private String menuName;//菜单名称

    @Column(name = "parent_id", columnDefinition = "bigint(20) comment '父级ID'")
    private Long parentId;//父级ID

    @Column(name = "order_num", columnDefinition = "int(10) comment '显示顺序'")
    private Integer orderNum;//显示顺序

    @Column(name = "path", columnDefinition = "varchar(100) comment '路由地址'")
    private String path;//路由地址

    @Column(name = "component", columnDefinition = "varchar(255) comment '组件路径'")
    private String component;//组件路径

    @Column(name = "menu_type", columnDefinition = "varchar(10) comment '菜单类型 C目录 M菜单 B按钮'")
    private String menuType;//菜单类型 C目录 M菜单 B按钮

    @Column(name = "visible", columnDefinition = "char(1) comment '显示状态 （0显示 1隐藏）'")
    private String visible;//显示状态 0-显示 1-隐藏

    @Column(name = "status", columnDefinition = "char(1) comment '状态 （0启用 1禁用）'")
    private String status;//状态 0-启用 1-禁用

    @Column(name = "perms", columnDefinition = "varchar(255) comment '权限标识'")
    private String perms;//权限标识，接口控制sysUser:list:index

    @Column(name = "icon", columnDefinition = "varchar(255) comment '菜单图标'")
    private String icon;//菜单图标

    /** 子菜单 */
    @Transient
    private List<SysMenu> children = new ArrayList<SysMenu>();

}
